package com.meeting.mapper;

import com.meeting.dto.RoomEquipmentDTO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RoomEquipmentMapper {
    List<RoomEquipmentDTO> selectDeviceNamesByRoomIds(List<Integer> roomIds);
    
    /**
     * 批量插入会议室与设备的关联
     * @param roomId 会议室ID
     * @param equipmentTypeIds 设备类型ID列表
     * @return 插入成功的条数
     */
    int insertBatch(@Param("roomId") Integer roomId, @Param("equipmentTypeIds") List<Integer> equipmentTypeIds);
    
    /**
     * 根据会议室ID删除设备关联
     * @param roomId 会议室ID
     * @return 删除成功的条数
     */
    @Delete("DELETE FROM rooms_equipment WHERE rooms_id = #{roomId}")
    int deleteByRoomId(@Param("roomId") Integer roomId);
}
